package pers.qianyu.domain.common;

import lombok.*;

import javax.validation.*;
import javax.validation.constraints.*;
import java.io.*;

/**
 * 通用分页查询对象
 *
 * @author mizzle rain
 * @date 2020-10-12 9:23
 */
@Data
public class PageQuery<T> implements Serializable {
    private static final long serialVersionUID = -5391507624525453574L;
    /**
     * 页码
     */
    @NotNull(message = "页码不能为空！")
    @Min(value = 1, message = "页号必须为正数")
    private Integer pageNo = 1;
    /**
     * 页面大小
     */
    @NotNull(message = "每页条数不能为空！")
    @Max(value = 100, message = "每页条数不能超过100条")
    private Integer pageSize = 20;
    /**
     * 动态查询条件
     * - 级联校验
     */
    @Valid
    private T query;
}
